package org.eclipse.moquette.parser.netty;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import org.eclipse.moquette.proto.messages.AbstractMessage;
import org.eclipse.moquette.proto.messages.PingRespMessage;

/**
 *
 * PingResp 编码
 *
 * Created by alex on 15-5-25.
 */
public class PingRespEncoder extends DemuxEncoder<PingRespMessage> {

    @Override
    protected void encode(ChannelHandlerContext ctx, PingRespMessage msg, ByteBuf out) {
        //一个固定头部搞定
        out.writeByte(AbstractMessage.PINGRESP << 4).writeByte(0);
    }
}
